package com.sakuraio.nextj.core.error.exception;

import cn.hutool.core.util.StrUtil;
import com.sakuraio.nextj.core.error.Errors;
import com.sakuraio.nextj.core.protocol.R;

/**
 * @author nekoimi 2023/9/21 18:29
 */
public class OperationException extends BusinessException {

    public OperationException() {
        super(Errors.OPERATION_EXCEPTION);
    }

    public OperationException(String message, Object... params) {
        super(R.error(Errors.OPERATION_EXCEPTION.code(), StrUtil.format(message, params)).build());
    }

    public OperationException(Throwable e) {
        super(R.error(Errors.OPERATION_EXCEPTION.code(), e.getMessage()).build());
    }
}
